﻿using MongoExplorerTool.Infra.Base;

namespace MongoExplorerTool.Infra.Connection
{
    public class ConnectionInfo : EntityBase
    {
        #region Properties
        private string _name;
        public string Name { get { return this._name; } set { this.SetProperty(ref this._name, value); } }

        private string _server;
        public string Server { get { return this._server; } set { this.SetProperty(ref this._server, value); } }

        private string _port;
        public string Port { get { return this._port; } set { this.SetProperty(ref this._port, value); } }

        private string _username;
        public string Username { get { return this._username; } set { this.SetProperty(ref this._username, value); } }

        private string _password;
        public string Password { get { return this._password; } set { this.SetProperty(ref this._password, value); } }
        #endregion Properties

        #region Methods
        public bool IsValid()
        {
            return !(string.IsNullOrWhiteSpace(this.Name) || string.IsNullOrWhiteSpace(this.Server));
        }
        #endregion
    }
}
